<?php

namespace App\Http\Api\Services;

use App\Models\Client as ClientModel;
use App\Services\MiniProgram as MpService;
use App\Services\MiniProgram\Weixin as WeixinMpService;
use App\Traits\Client as ClientTrait;

class MiniProgrom extends Service
{
    use ClientTrait;

    public function getMpService(): MpService
    {
        $platformType = $this->getClientType();

        if ($platformType === ClientModel::TYPE_MP_WEIXIN) {
            return new WeixinMpService();
        }

        throw new \Exception('Invalid Mini Program Provider');
    }

}
